package com.fasc.open.api.client;

import com.fasc.open.api.bean.base.BaseRes;
import com.fasc.open.api.bean.res.service.AccessTokenRes;
import com.fasc.open.api.constants.OpenApiUrlConstants;
import com.fasc.open.api.exception.ApiException;

/**
 * @author Fadada
 * 2021/9/8 16:09:38
 */
public class ServiceClient {
    private OpenApiClient openApiClient;

    public ServiceClient(OpenApiClient openApiClient) {
        this.openApiClient = openApiClient;
    }

    public BaseRes<AccessTokenRes> getAccessToken() throws ApiException {
        return openApiClient.invokeApi(null, OpenApiUrlConstants.SERVICE_GET_ACCESS_TOKEN, AccessTokenRes.class);
    }

}
